# $Id: PKGBUILD 87575 2013-04-03 10:32:40Z alucryd $
# Maintainer: Maxime Gauduin <alucryd@gmail.com>
# Contributor: TingPing <tingping@tingping.se>

pkgname=hexchat
pkgver=2.9.5
pkgrel=4
pkgdesc="A popular and easy to use graphical IRC (chat) client"
arch=('i686' 'x86_64')
url="http://www.hexchat.org/"
license=('GPL')
depends=('dbus-glib' 'desktop-file-utils' 'hicolor-icon-theme' 'libnotify' 'libproxy' 'libsexy' 'pciutils')
makedepends=('perl' 'python2')
optdepends=('enchant: Spell check'
            'perl: Perl plugin'
            'python2: Python plugin')
options=('!libtool')
install=${pkgname}.install
source=("http://dl.hexchat.org/hexchat/hexchat-${pkgver}.tar.xz")
sha256sums=('11dfd0fbfb88d8dbb38f631fab8a7dffbb179f7f7dafe316953ed6f513ac623d')

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}

# Build
  ./autogen.sh
  ./configure --prefix=/usr --enable-{shm,spell=libsexy,textfe}
  make
}

package() {
  cd "${srcdir}"/${pkgname}-${pkgver}

# Install
  make DESTDIR="$pkgdir" install

# IRC Mime Types
  desktop-file-edit --add-mime-type='x-scheme-handler/irc;x-scheme-handler/ircs' --set-key=Exec --set-value='sh -c "hexchat --existing --url %u || exec hexchat"' "$pkgdir/usr/share/applications/hexchat.desktop"
}

# vim: ts=2 sw=2 et:
